import actionStaticPool from "./ActionStaticPool";

export type ActionStaticConfigType = {
    // 要扫描的文件类型，不指定则扫描全部类型
    types?: string[],
    // 要忽略掉的文件类型
    ignoreTypes?: string[],
    // 要忽略掉的
    ignores?: string[],
    // 过滤器
    filter?: (path: string) => boolean,
}

class ActionStaticRegistrar {

    staticPath?: string
    staticConfig?: ActionStaticConfigType = {}

    path(path: string) {
        this.staticPath = path;
        return this;
    }

    config(config: ActionStaticConfigType) {
        this.staticConfig = config;
    }

    get(path: string) {
        return actionStaticPool.pathMap[path]
    }
}

const actionStaticRegistrar = new ActionStaticRegistrar();
export default actionStaticRegistrar
